package com.qing.gui.jframe;

import javax.swing.*;
import java.awt.*;

public class ImageIconDemo extends JFrame {

    public void init(){

        JLabel label = new JLabel("ICON");
        label.setIcon(new ImageIcon(ImageIconDemo.class.getResource("1234.jpg")));
        label.setHorizontalAlignment(SwingConstants.CENTER);

        Container contentPane = getContentPane();
        contentPane.add(label);
        contentPane.setBackground(Color.PINK);

        setVisible(true);
        setBounds(300,300,500,500);

    }


    public static void main(String[] args) {
        new ImageIconDemo().init();
    }
}
